package ontologies;

import jade.content.onto.BCReflectiveIntrospector;
import jade.content.onto.BasicOntology;
import jade.content.onto.Ontology;
import jade.content.onto.OntologyException;
import jade.content.schema.ConceptSchema;
import jade.content.schema.ObjectSchema;
import jade.content.schema.PrimitiveSchema;

public class AuctionOntology extends Ontology {
	
	public static final String NAME = "Meeting-Scheduling-Ontology";

	public static final String CITY = "City";
	public static final String PARCEL = "Parcel";

	private static Ontology theInstance = new AuctionOntology();
	
	public static Ontology getOntology(){
		return theInstance;
	}
	
	private AuctionOntology(){
		super(NAME, BasicOntology.getInstance(), new BCReflectiveIntrospector());
		
		try{
			//Concepts.
			add(new ConceptSchema(CITY),City.class);
			add(new ConceptSchema(PARCEL),Parcel.class);

			ConceptSchema cs = (ConceptSchema)getSchema(CITY);
			cs.add("name",(PrimitiveSchema)getSchema(BasicOntology.STRING),ObjectSchema.MANDATORY);
			cs.add("distanceToCompany",(ConceptSchema) getSchema(BasicOntology.FLOAT),ObjectSchema.OPTIONAL);
				
			
			cs = (ConceptSchema)getSchema(PARCEL);
			cs.add("name", (PrimitiveSchema)getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
			cs.add("description",(PrimitiveSchema)getSchema(BasicOntology.STRING),ObjectSchema.OPTIONAL);
			cs.add("destination",(ConceptSchema)getSchema(CITY),ObjectSchema.OPTIONAL);
			cs.add("category",(PrimitiveSchema)getSchema(BasicOntology.STRING),ObjectSchema.OPTIONAL);
		       
	    } catch (OntologyException oe) {
	      oe.printStackTrace();
	    }
	}

}
